class CulturalHeritage::Period < ActiveRecord::Base
  validates :name, :presence => {:message => "El nombre del Periodo es requerido"}
  default_scope where("deleted = 0")
  has_many :list_obj_cultures, :class_name => 'CulturalHeritage::Culture',  :foreign_key => 'period'

  def str_subGroup
    if subGroup.blank?
      return ""
    else
      obj_subGroup = CulturalHeritage::SubGroup.find(subGroup)
      return obj_subGroup.name
    end
  end
end
